Carbon


HGetVol

Header: Files.h Carbon status: Supported

Determines the current default volume and default directory.

OSErr HGetVol (
    StringPtr volName, 
    SInt16 *vRefNum, 
    SInt32 *dirID
);
volName

On return, a pointer to the name of the default volume. If you do not want the name of the default volume returned, set this parameter to NULL.

vRefNum

On return, a pointer to a volume reference number or a working directory reference number.

The HGetVol function returns a working directory reference number in the vRefNum parameter if the previous call to HSetVol (or PBHSetVolSync or PBHSetVolAsync) passed in a working directory reference number. If, however, you have previously called HSetVol (or PBHSetVolSync or PBHSetVolAsync) specifying the target volume with a volume reference number, then HGetVol returns a volume reference number in the vRefNum parameter.

dirID

On return, a pointer to the directory ID of the default directory.

function result

A result code.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.

CARBON NOTES

Carbon applications should use HGetVol and HSetVol to get and set the default directory. GetVol and SetVol are no longer supported and working directories are not supported.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)